Squid + DansGuardian
2015/11/08 |
Install DansGuardian to configure contents filtering.
|
|
[1] | Install DansGuardian. This example based on the proxy settings on Clients with [prox.srv.world:3128]. Replace the value to your own environment. |
[root@prox ~]#
dnf -y install dansguardian
[root@prox ~]#
vi /etc/dansguardian/dansguardian.conf # line 26: change to your own lang language = ' japanese '
# line 88: change it (DansGuardian listens) to the port for Clients filterport = 3128
# line 94: specify the port which Squid listens proxyport = 8080
[root@prox ~]#
vi /etc/squid/squid.conf # line 59: change (same with DansGuardian's setting) http_port 8080
systemctl restart squid [root@prox ~]# systemctl start dansguardian [root@prox ~]# systemctl enable dansguardian |
[2] | Configure for filtering. |
[root@prox ~]#
vi /etc/dansguardian/lists/bannedsitelist # specify domain names you'd like to block example.com
[root@prox ~]#
systemctl restart dansguardian # other lists you can define
bannedextensionlist ⇒ banned edextension bannediplist ⇒ banned client IP address bannedmimetypelist ⇒ banned MIME Type bannedphraselist ⇒ banned phrase bannedregexpheaderlist ⇒ banned header(regexp) bannedregexpurllist ⇒ banned URL(regexp) bannedsitelist ⇒ banned domain bannedurllist ⇒ banned URL contentregexplist ⇒ replace contents(regexp) exceptionextensionlist ⇒ exception extension exceptionfilesitelist ⇒ exception file domain exceptionfileurllist ⇒ exception file URL exceptioniplist ⇒ exception client IP address exceptionmimetypelist ⇒ exception MIME Type exceptionphraselist ⇒ exception phrase exceptionregexpurllist ⇒ exception URL(regexp) exceptionsitelist ⇒ exception domain exceptionurllist ⇒ exception URL filtergroupslist ⇒ filter group greysitelist ⇒ grey domain greyurllist ⇒ grey URL |
[3] | Try to access from ClientPC with Web browser to the URL you configured and make sure it is redirected like follows. |